package com.ddxz.tool.web.common;

import com.ddxz.tool.core.convert.StringUtil;

/**
 * description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2020/6/12
 */
public interface ConstData {
    int OK_STATUS = 200;

    String KEY_DATA = "data";

    String KEY_MESSAGE = "message";

    String OK_MESSAGE = "SUCCESS";

    String KEY_STATUS = "status";

    default String getLeftSearch(String keyword) {
        if(StringUtil.isEmpty(keyword)) {
            return null;
        } else {
            return "%" + keyword;
        }
    }

    default String getRightSearch(String keyword) {
        if(StringUtil.isEmpty(keyword)) {
            return null;
        } else {
            return keyword + "%";
        }
    }

    default String getBothSearch(String keyword) {
        if(StringUtil.isEmpty(keyword)) {
            return null;
        } else {
            return "%" + keyword + "%";
        }
    }

}
